package com.jiepu.daily.corejava.advanceed.part7io.day0808;

import java.io.*;

/**
 * @Description:
 * @author: xinjie
 * @date: 2020/8/8  16:06
 */
public class IODemo11 {

	public class MyStream implements AutoCloseable{

		@Override
		public void close() throws Exception {

		}
	}
	public static void main(String[] args) throws IOException {

		String path = "src/com/jiepu/daily/advanceed/part7_io/io_test/demo11.txt";
		// 可以定义 若干个资源类型的对象   执行完毕 自动关闭


		try (
				FileInputStream fis = new FileInputStream(path);
				BufferedInputStream bis = new BufferedInputStream(fis);
		) {
			byte[] buf = new byte[16];
			int len = -1;
			while ((len = fis.read(buf)) != -1) {

			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} // main
}
